<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use DB;
use Session;
use Gregwar\Captcha\CaptchaBuilder;

class CodeController extends Controller
{
	
	// 生成 验证码
	public function createCode( $rand='', Request $request )
	{
		// 清除 缓存
		ob_end_clean();
		$builder = new CaptchaBuilder;
		$builder->build(100,40);
		Session::put('loginCode',$builder->getPhrase());
		header('Content-type: image/jpeg');
		$builder->output();
		
	}
	
	
}
